﻿using System.ComponentModel;
using System.Collections.Specialized;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Collections;
using AbstraX.ClientInterfaces;
using System.ServiceModel.DomainServices.Client;
using TreeBuilder.Services;
using UIObjects.TreeViewInterfaces;
using System.Windows.Controls;
using MvvmTreeView;

namespace TreeBuilder.Contracts
{
    public interface IRootSourcesCollection : ICollection<ITreeNodeRootSource>, INotifyCollectionChanged, INotifyPropertyChanged
    {
    }

    public interface IRootsCollection : ICollection<ITreeBuilderRoot>, INotifyCollectionChanged, INotifyPropertyChanged
    {
    }

    public interface ITreeBuilderService
    {
        T ConvertImage<T>(byte[] imageData);
        NodeInvokeOperation<Guid> GetServerImageFormat(ITreeNodeImage image);
        NodeInvokeOperation<TreeNodeImageFormat> GetTreeNodeImageFormat(ITreeNodeImage image);
        NodeImageLoadOperation LoadImageEditor(ITreeNodeBase parent, string fileName);
        ObservableCollection<IElement> GetPotentialRootSources();
        ObservableCollection<ITreeNodeBase> LoadChildren(ITreeNodeServerEntity entity);
        IRootsCollection TreeBuilderRoots { get; }
        IParentBase RootSource { set; }
        byte[] LoadImageForItemType(string itemTypeName);
        byte[] LoadShortcutImage();
        SubmitOperation UpdateImage(ITreeNodeImage image);
        SubmitOperation UpdateNode<T>(T node) where T : ITreeNodeBase;
        SubmitOperation DeleteNode<T>(T node) where T : ITreeNodeBase;
        InvokeOperation BuildTree(ITreeBuilderRoot root);
        Type GetNodeIDType(string id);
        ItemGenerationOperation<T> GenerateItemFromID<T>(string id) where T : IBase;
        void ReportException(ITreeNodeBase node, Exception ex);
        NodeCreateOperation<ITreeNodeBase> CreateShortcut(ITreeNodeBase parent, ITreeNodeBase shortcutNode);
        NodeCreateOperation<ITreeNodeAttributeNode> CreateAttributeNode(ITreeNodeBase parent, IAttribute attribute);
        NodeCreateOperation<ITreeNodeElementNode> CreateElementNode(ITreeNodeBase parent, IElement element);
        NodeCreateOperation<ITreeNodeFolder> CreateFolderNode(ITreeNodeBase parent, IBase folderSource);
        NodeCreateOperation<ITreeNodeMenuItem> CreateMenuItem(ITreeNodeBase parent, IBase menuSource);
        NodeCreateOperation<ITreeNodeMenuItem> CreateMenuItem(ITreeNodeBase parent, IBase menuSource, TreeNodeMenuItemStockAction stockAction);
        NodeCreateOperation<ITreeNodeMenuItem> CreateMenuItem(ITreeNodeBase parent, IBase menuSource, IOperation operation);
        NodeCreateOperation<ITreeNodeTransferMapping> CreateTransferCreationMappingNode(ITreeNodeBase parent, TransferCreationMappingType mappingType, IBase targetSource);
        NodeCreateOperation<ITreeNodePropertyBinding> CreatePropertyBindingNode(ITreeNodeBase parent, TreeNodePropertyType propertyType, IAttribute attribute);
        NodeCreateOperation<ITreeNodePropertyBinding> CreatePropertyBindingNode(ITreeNodeBase parent, TreeNodePropertyType propertyType, IElement element);
        NodeCreateOperation<ITreeNodePropertyBinding> CreatePropertyBindingNode(ITreeNodeBase parent, TreeNodePropertyType propertyType, IAttribute attribute, bool sourceIsURLBinding);
        NodeCreateOperation<ITreeNodePropertyBinding> CreatePropertyBindingNode(ITreeNodeBase parent, TreeNodePropertyType propertyType, TreeNodePropertyStockBinding stockBinding);
        NodeCreateOperation<ITreeNodePropertyBinding> CreateImageBindingNode(ITreeNodeBase parent, ITreeNodeImage treeNodeImage);
        NodeCreateOperation<ITreeNodeQuery> CreateQueryNode(ITreeNodeBase parent, IBase baseObject);
        NodeCreateOperation<ITreeNodeAdvancedQuery> CreateAdvancedQueryNode(ITreeNodeBase parent, IBase baseObject);
        NodeCreateOperation<ITreeNodeRootSource> CreateRootSourceNode(ITreeNodeBase parent, IBase baseObject);
        NodeInvokeOperation<TreeNodePropertyType> GetItemBindingPropertyTypes(ITreeNodeServerEntity parentEntity);
        NodeInvokeOperation<TransferCreationMappingType> GetTransferCreationMappingTypes(ITreeNodeServerEntity parentEntity);
        NodeInvokeOperation<bool> HasImage(ITreeNodePropertyBinding propertyBinding);
        NodeInvokeOperation<bool> HasImage(ITreeNodeMenuItem menuItem);
        InvokeOperation<bool> OrphansExist();
        NodeInvokeOperation<ITreeNodeImage> GetImage(ITreeNodePropertyBinding propertyBinding);
        NodeInvokeOperation<ITreeNodeImage> GetImage(ITreeNodeMenuItem menuItem);
        SubmitOperation DeleteImage(ITreeNodeImage image);
        SubmitOperation DetachImage(ITreeNodeImage image);
    }
}

//#endif